package com.hanzidong.bean;

import java.io.Serializable;
import java.util.Date;

import javax.validation.constraints.NotBlank;

import org.springframework.format.annotation.DateTimeFormat;

/**
 * 用户类
 * @author 
 * @version 
 */
public class User implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1864753390700377693L;
	
	private Integer id;
	@NotBlank(message = "用户名不能为空")
	private String username; // 用户名
	@NotBlank(message = "密码不能为空")
	private String password; // 密码
	@NotBlank(message = "用户昵称不能为空")
	private String nickname; // 用户昵称
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	private Date birthday; // 生日
	private Integer gender; // 性别 0:女 1:男
	private Integer locked; // 0:正常,1:禁用
	private Date created; // 创建日期
	private Date updated; // 修改日期
	private Integer role; // 0:普通用户,1:管理员
	private String url; // 个人博客网址
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getNickname() {
		return nickname;
	}
	public void setNickname(String nickname) {
		this.nickname = nickname;
	}
	public Date getBirthday() {
		return birthday;
	}
	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}
	public Integer getGender() {
		return gender;
	}
	public void setGender(Integer gender) {
		this.gender = gender;
	}
	public Integer getLocked() {
		return locked;
	}
	public void setLocked(Integer locked) {
		this.locked = locked;
	}
	public Date getCreated() {
		return created;
	}
	public void setCreated(Date created) {
		this.created = created;
	}
	public Date getUpdated() {
		return updated;
	}
	public void setUpdated(Date updated) {
		this.updated = updated;
	}

	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public Integer getRole() {
		return role;
	}
	public void setRole(Integer role) {
		this.role = role;
	}
	public User(Integer id, @NotBlank(message = "用户名不能为空") String username,
			@NotBlank(message = "密码不能为空") String password, @NotBlank(message = "用户昵称不能为空") String nickname,
			Date birthday, Integer gender, Integer locked, Date created, Date updated, Integer role, String url) {
		super();
		this.id = id;
		this.username = username;
		this.password = password;
		this.nickname = nickname;
		this.birthday = birthday;
		this.gender = gender;
		this.locked = locked;
		this.created = created;
		this.updated = updated;
		this.role = role;
		this.url = url;
	}
	public User() {
		super();
		// TODO Auto-generated constructor stub
	}
	@Override
	public String toString() {
		return "User [id=" + id + ", username=" + username + ", password=" + password + ", nickname=" + nickname
				+ ", birthday=" + birthday + ", gender=" + gender + ", locked=" + locked + ", created=" + created
				+ ", updated=" + updated + ", role=" + role + ", url=" + url + "]";
	}

	
	
}
